package com.bice.dao;

import java.io.Serializable;
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;

public interface Dao<T extends IEntity, PK extends Serializable> extends Serializable {

    public PK save(T entity);
    public T get(Class<T> type, PK id);
    public T get(String name, PK id);
    public void update(T entity);
    public void delete(T entity);
    public List<T> getAll(Class<T> type);
    public List<T> get(DetachedCriteria criteria);
    public T getUnique(DetachedCriteria criteria);
    public List<T> get(DetachedCriteria criteria, int firstResult, int maxResults);
    public List<T> get(String hql, Object... values);
    public int count(DetachedCriteria criteria);

}